package com.huabo.monitor.oracle.mapper;

import com.huabo.monitor.oracle.entity.TblAssesscategory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;
import tk.mybatis.mapper.common.BaseMapper;

import java.math.BigDecimal;
import java.util.List;

public interface TblAssesscategoryMapper extends BaseMapper<TblAssesscategory> {
    List<TblAssesscategory> getTreeByNodeId(BigDecimal pId);

    List<TblAssesscategory> findByTempleId(BigDecimal tmplId, BigDecimal nodeId);

    @Delete("delete from TBL_ASSESSCATEGORY where ASSTEMID = #{tmplId}")
    void deleteByTempleId(@Param("tmplId") BigDecimal tmplId);

    List<TblAssesscategory> findByTempleId(BigDecimal tmplId);

    @Select("select * FROM TBL_ASSESSCATEGORY F WHERE FATHERASSCATID IS NULL AND F.ASSTEMID = #{tmplId};")
    List<TblAssesscategory> getTreeRoot(@Param("tmplId") BigDecimal tmplId);

    List<TblAssesscategory> getParentList(BigDecimal id);

    List<Object[]> getHengXiang(BigDecimal id);

    List<TblAssesscategory> listBySql(String sql);

    List<TblAssesscategory> findAllAssesscategory(String toString);

    BigDecimal save(TblAssesscategory tblAssesscategory);

    void update(TblAssesscategory tblAssesscategory2);

    TblAssesscategory findById(BigDecimal bigDecimal);

    TblAssesscategory get(Class<TblAssesscategory> tblAssesscategoryClass, BigDecimal id);
}
